package com.hill.study;

import java.util.Stack;

public class StackTest {
    public static void main(String[] args) {
        Stack<String> stack = new Stack<String>();
        for(String s :"my dog is wangcai".split(" "))
            stack.push(s);
        while (!stack.empty()){
            System.out.print(stack.pop() + " ");
        }
    }
}
